/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ubbcluj.dbmanagementserver.model;

import java.util.List;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlType;

/**
 *
 * @author Bea
 */
@XmlType
public class Table {

    private String name;
    private List<String> primaryKey;
    private TableStructure tableStructure;
    private List<ForeignKey> foreignKeys;
    private List<String> uniqueKeys;

    public Table(String name, List<String> primaryKey, TableStructure tableStructure, List<ForeignKey> foreignKeys, List<String> uniqueKeys) {
        this.name = name;
        this.primaryKey = primaryKey;
        this.tableStructure = tableStructure;
        this.foreignKeys = foreignKeys;
        this.uniqueKeys = uniqueKeys;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<String> getPrimaryKey() {
        return primaryKey;
    }

    public void setPrimaryKey(List<String> primaryKey) {
        this.primaryKey = primaryKey;
    }

    public TableStructure getTableStructure() {
        return tableStructure;
    }

    public void setTableStructure(TableStructure tableStructure) {
        this.tableStructure = tableStructure;
    }

    public List<ForeignKey> getForeignKeys() {
        return foreignKeys;
    }

    @XmlElementWrapper
    @XmlElement(name = "foreignKey")
    public void setForeignKeys(List<ForeignKey> foreignKeys) {
        this.foreignKeys = foreignKeys;
    }

    public List<String> getUniqueKeys() {
        return uniqueKeys;
    }

    @XmlElementWrapper
    @XmlElement(name = "uniqueKey")
    public void setUniqueKeys(List<String> uniqueKeys) {
        this.uniqueKeys = uniqueKeys;
    }

}
